package com.fumasoft.dynamic.listener;

import com.aliyun.openservices.ons.api.Action;
import com.aliyun.openservices.ons.api.ConsumeContext;
import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.MessageListener;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 单据单据消息监听.
 */
@Slf4j
@Component
public class BillListener implements MessageListener {

    @Override
    public Action consume(Message message, ConsumeContext consumeContext) {
        String s = new String(message.getBody());
        log.info("单据消费Listener-收到消息： Topic:{}, Tag:{}, data:{}", message.getTopic(), message.getTag(), s);
        return Action.CommitMessage;
    }

}
